﻿package frEngine.shader.filters.fragmentFilters
{
    import __AS3__.vec.*;
    import baseEngine.core.*;
    import frEngine.shader.*;
    import frEngine.shader.filters.*;
    import frEngine.shader.registType.*;

    public class SwordLightFragmentFilter_Bone extends TextureFilter
    {
        public var swordUVOffset:Vector.<Number>;

        public function SwordLightFragmentFilter_Bone(param1:Texture3D)
        {
            this.swordUVOffset = this.Vector.<Number>([0, 1, 0, 0]);
            super(param1);
            return;
        }// end function

        override public function setRegisterParams(param1:Program3dRegisterInstance) : void
        {
            super.setRegisterParams(param1);
            var _loc_2:* = param1.getParamByName("{swordUVOffset}", false);
            var _loc_3:* = this.swordUVOffset;
            _loc_2.value = this.swordUVOffset;
            return;
        }// end function

        override public function get programeId() : String
        {
            if (texture && texture.loadedAndUpload)
            {
                return "swordUVOffset:" + FilterBase.ATLFormat[texture.format] + ",mip:" + texture.mipMode;
            }
            return null;
        }// end function

        override public function preCreateFragmentUvCoord(param1:Program3dRegisterInstance) : String
        {
            var _loc_2:* = new Array();
            var _loc_3:* = super.preCreateFragmentUvCoord(param1);
            _loc_2.push(new ToBuilderInfo("fc4", "{swordUVOffset}", false, 1, this.swordUVOffset));
            var _loc_4:* = FilterName.V_UvOriginalPos;
            _loc_3 = _loc_3 + "sub           {F_UVPostion}.x        {F_UVPostion}.x\t\t\t\tfc4.x    \t\t\n";
            _loc_3 = _loc_3 + "mul           {F_UVPostion}.x        {F_UVPostion}.x\t\t\t\tfc4.y         \t\n";
            _loc_3 = param1.toBuild(_loc_3, _loc_2);
            return _loc_3;
        }// end function

    }
}
